﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using ToolsLayer;
namespace Webcar
{
    public partial class Print : PageBase
    {
        protected string xml
        {
            get { return Session["xml"] == null ? "" : Server.MapPath(Session["xml"].ToString()); }
        }
        protected string sql
        {
            get { return Session["sql"] == null ? "" : Session["sql"].ToString(); }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.SetViewData();
            PublicFunction.SetGridViewColumnsCss(this.GridView1, "tableColumns");
        }

        protected void SetViewData()
        {
            if (string.IsNullOrEmpty(xml))
                return;
            if (string.IsNullOrEmpty(sql))
                return;
            ViewManager.BindGridView(this.GridView1, this.xml);
            DataSet ds = DB.ExecuteDataset(sql);
            this.GridView1.DataSource = ds;
            this.GridView1.DataBind();
        }
    }
}
